<template>
  <div class="title" :class="{ more: titleData.mshopLinkData }">
    <img :src="titleData.floorImg" alt="" />
    <div
      v-if="titleData.mshopLinkData"
      class="more_btn"
      :style="{ borderColor: buttonColor, color: buttonColor }"
      @click="moreClick"
    >
      更多<van-icon name="arrow" size="8px" :color="buttonColor" />
    </div>
  </div>
</template>
<script>
export default {
  props: {
    titleData: {
      type: Object,
      default() {
        return {};
      }
    },
    buttonColor: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      moreBtnUrl: '',
      floorTitleImg: ''
    };
  },
  methods: {
    moreClick() {
      this.titleData.linkType = 1;
      this.$emit('moreClick', this.titleData);
    }
  }
};
</script>
<style lang="scss" scoped>
.title {
  box-sizing: border-box;
  padding: 0 10px;
  position: relative;
  margin-top: 10px;
  img {
    width: 100%;
    display: block;
    box-sizing: border-box;
    margin-bottom: 6px;
  }
  .more_btn {
    width: 39px;
    height: 19px;
    display: flex;
    align-self: flex-end;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-family: Helvetica;
    color: red;
    border: 1px solid red;
    border-radius: 19px;
    //   padding:0 2px;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
  }
}
</style>
